package cn.javacc.nav.web;

import java.util.List;

import javax.inject.Inject;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import cn.javacc.nav.domain.LinkTracking;
import cn.javacc.nav.service.LinkTrackingService;
import cn.javacc.util.BaseController;

@Controller
@RequestMapping("linkTracking")
public class LinkTrackingController extends BaseController {
	@Inject
	private LinkTrackingService linkTrackingService;

	@RequestMapping(value = "/list", method = RequestMethod.GET)
	public String listLinkTrackings(@RequestParam(defaultValue = "0") Integer offset, @RequestParam(defaultValue = "24") Integer fetchSize, Model model) {
		List<LinkTracking> linkTrackings = linkTrackingService.listLinkTrackings(offset, fetchSize);
		model.addAttribute("linkTrackings", linkTrackings);
		return "cms/tracking/linkTrackingList";
	}
}
